home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98c.txt
/
000109_icon-group-sender _Tue Dec 8 10:06:37 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA28737
for icon-group-addresses; Tue, 8 Dec 1998 10:06:28 -0700 (MST)
Message-Id: <199812081706.KAA28737@baskerville.CS.Arizona.EDU>
Date: Tue, 08 Dec 1998 03:52:39 -0600
From: MJE <evans@gte.net>
To: icon-group@optima.CS.Arizona.EDU
Subject: Re: Past Keyword / Coexpr Help
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Clinton Jeffery wrote:
>
> SW> procedure past(s)
> SW> suspend (tab(find(s)),match(s))
> SW> end
>
> NL> procedure past(s1, s2, i1, i2)
> NL> suspend find(s1, s2, i1, i2) + *s1
> NL> end
>
> MEvans> I like Steve Wampler's answer. Since "find" is a generator,
> MEvans> presumably this function will also behave as a generator. I would
> MEvans> still lobby for the "past" keyword, but no complaints.
>
> Gee, both of these solutions behave just fine as a generator. Nevin's
> looks more efficient and works outside of string scanning environments. :-)
>
> For the record, I've wanted a past() function before, as well. My code is
> often riddled with find(s) + *s ...
>
> Clint
What everyone is missing about procedures-that-do-the-job is the speed
consideration. Think about embedding either procedure in a deep inner
loop of some kind. At that point, it is much preferable to have a
keyword, which
(a) avoids any overhead of procedure calling, (b) doesn't have to both
find and then match the same text (redundancy), (c) simplifies the code
readability
So with Clint I must say that the keyword is still a good idea.
Thanks for the advice however, it gets me off the dime.
Mark